package com.gljx.web.Entity.JournalEntry;

import java.math.BigDecimal;

public class QuarterlyJournal {
	
	private String name2;//需要统计项目的名称
	private String cfmount2;//统计的金额
	private String dateMonth;//当前月
	private String cfmount_1;//每个季度3个月
	private String cfmount_2;
	private String cfmount_3;
	private BigDecimal sumQuarterly;//季度总额
	
	
			
	public BigDecimal getSumQuarterly() {
		BigDecimal cfmount1;
		BigDecimal cfmount2;
		BigDecimal cfmount3;
		if(!cfmount_1.contains("/")){
			if(cfmount_1.contains("-")){
				//System.out.println(" 之前:"+cfmount_1);
				String data[] = cfmount_1.split("-");	
				BigDecimal bigDecimal = new BigDecimal(data[1]);
				cfmount1 = bigDecimal.multiply(new BigDecimal(-1));
			}else{
				cfmount1 = new BigDecimal(cfmount_1);
			}
			if(cfmount_2.contains("-")){
				String data[] = cfmount_2.split("-");
				BigDecimal bigDecimal = new BigDecimal(data[1]);
				cfmount2 = bigDecimal.multiply(new BigDecimal(-1));
			}else{
				cfmount2 = new BigDecimal(cfmount_2);
			}
			if(cfmount_3.contains("-")){
				String data[] = cfmount_3.split("-");
				BigDecimal bigDecimal = new BigDecimal(data[1]);
				cfmount3 = bigDecimal.multiply(new BigDecimal(-1));
			}else{
				cfmount3 = new BigDecimal(cfmount_3);
			}
			sumQuarterly = cfmount1.add(cfmount2).add(cfmount3);
			//sumQuarterly=(cfmount1+cfmount2+cfmount3)+"";					
		}		
		//System.out.println(sumQuarterly);
		return sumQuarterly;
	}
	
	
	public void setSumQuarterly(BigDecimal sumQuarterly) {
		this.sumQuarterly = sumQuarterly;
	}
	public String getCfmount2() {
		return cfmount2;
	}
	public void setCfmount2(String cfmount2) {
		this.cfmount2 = cfmount2;
	}
	public String getCfmount_1() {
		return cfmount_1;
	}
	public void setCfmount_1(String cfmount_1) {
		this.cfmount_1 = cfmount_1;
	}
	public String getCfmount_2() {
		return cfmount_2;
	}
	public void setCfmount_2(String cfmount_2) {
		this.cfmount_2 = cfmount_2;
	}
	public String getCfmount_3() {
		return cfmount_3;
	}
	public void setCfmount_3(String cfmount_3) {
		this.cfmount_3 = cfmount_3;
	}
	public String getName2() {
		return name2;
	}
	public void setName2(String name2) {
		this.name2 = name2;
	}
	
	public String getDateMonth() {
		return dateMonth;
	}
	public void setDateMonth(String dateMonth) {
		this.dateMonth = dateMonth;
	}
	
	
	
	
}
